package com.neutech.factorial;

public class SumTest {
    public static void main(String[] args) {
        System.out.println("所有数的和为" + sumTest(100));
    }
    public static double sumTest(int n) {
        //1+1/2+1/3+...+1/n   前n项和
        if (n == 1) {
            return 1;
        }
        return 1.0/n + sumTest(n - 1);
    }
}
